from typing import Dict, List, Set
# 树结构的 定义
# 节点。
class Node:
    """
    Represents a node in the hierarchical tree structure.
    """

    def __init__(self, text: str, index: int, children: Set[int], embeddings) -> None:
        self.text = text # 树的文本
        self.index = index # 树的索引
        self.children = children # 树的子孩子
        self.embeddings = embeddings # 树内容的embedding


class Tree:
    """
    Represents the entire hierarchical tree structure.
    """

    def __init__(
        self, all_nodes, root_nodes, leaf_nodes, num_layers, layer_to_nodes
    ) -> None:
        self.all_nodes = all_nodes # 所有的节点。
        self.root_nodes = root_nodes # 根节点
        self.leaf_nodes = leaf_nodes # 叶子结点。
        self.num_layers = num_layers # 层数
        self.layer_to_nodes = layer_to_nodes # 
